package top.xana.acg.base

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 * @author xana
 * @date 2022/4/22 0022 9:16
 * @email cv4096@qq.com
 **/

class ViewPager2Adapter(private val frags: List<Fragment>, fm: FragmentManager, lc: Lifecycle) :
    FragmentStateAdapter(fm, lc) {
    override fun getItemCount() = frags.size

    override fun createFragment(i: Int): Fragment {
        return frags[i]
    }

}